package com.bwie.gddproject.net;

import com.bwie.gddproject.index.model.bean.BaseBean;
import com.bwie.gddproject.index.model.bean.Classify2Bean;
import com.bwie.gddproject.index.model.bean.GoodCarBean;
import com.bwie.gddproject.index.model.bean.IndexBean;
import com.bwie.gddproject.index.model.bean.UserBean;
import com.bwie.gddproject.index.model.bean.VpBean;
import com.bwie.gddproject.login.model.LoginBean;
import com.bwie.gddproject.search.model.GoodsBean;
import com.bwie.gddproject.utils.ApiUtils;
import com.bwie.gddproject.xiangqing.model.IsAddBean;
import com.bwie.gddproject.xiangqing.model.XiangQingBean;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by 我走路带风 on 2017/12/13.
 */

public interface ResponseService {

    //请求主页数据
    @GET(ApiUtils.INDEX_PATH_URL)
    Observable<IndexBean> getIndex();
    //主页ViewPager
    @GET(ApiUtils.CLASSIFY_PATH_URL)
    Observable<VpBean> getVpData();
    //商品详情
    @GET(ApiUtils.DETAIL_PATH_URL)
    Observable<XiangQingBean> getXiangQingData(@Query("pid") String pid);
    //添加购物车
    @GET(ApiUtils.ADDCAR_PATH_URL)
    Observable<IsAddBean> isadd(@Query("pid") String pid);
    //关键词查找
    @GET(ApiUtils.SEARCH_PATH_URL)
    Observable<GoodsBean> searchGoods(@Query("keywords") String pid, @Query("page") String page);
    //左边分类
    @GET(ApiUtils.CLASSIFY_GOODS_PATH_URL)
    Observable<GoodsBean> getAClass(@Query("pscid") String pscid, @Query("page") String page);

    //右边分类
    @GET(ApiUtils.CLASSIFY_MIN_PATH_URL)
    Observable<Classify2Bean> getAClass2(@Query("cid") String cid);

    //获取购物车
    @GET(ApiUtils.SELECTCAR_PATH_URL)
    Observable<GoodCarBean> getGoodCar(@Query("uid") String uid);

    //删除购物车
    @GET(ApiUtils.DELETECAR_PATH_URL)
    Observable<BaseBean> deleteGoodCar(@Query("uid") String uid,@Query("pid") String pid);
    //更新购物车
//    @GET(ApiUtils.UPDATECAR_PATH_URL)
    //Observable<BaseBean> deleteGoodCar(@Query("uid") String uid,@Query("pid") String pid);

    //创建订单
    //@GET(ApiUtils.NEWDINGDAN_PATH_URL)
    //登录
    @GET(ApiUtils.LOGIN_PATH_URL)
    Observable<LoginBean> loginIn(@Query("mobile") String mobile,@Query("password") String password);
    //注册
    @GET(ApiUtils.REGIST_PATH_URL)
    Observable<BaseBean> registIn(@Query("mobile") String mobile,@Query("password") String password);
    //获取个人信息
    @GET(ApiUtils.USER_PATH_URL)
    Observable<UserBean> getUserInfo(@Query("uid") String uid);

}
